# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-qt5
pkgver=5.15.6
pkgrel=2
pkgdesc="A set of Python 3 bindings for the Qt toolkit"
url="https://www.riverbankcomputing.com/software/pyqt/"
arch="all"
license="GPL-3.0"
depends="
	py3-pyqt5-sip
	python3
	"
makedepends="
	libx11-dev
	py3-dbus-dev
	py3-opengl
	py3-pyqt-builder
	py3-sip
	python3-dev
	qt5-qtbase-dev
	qt5-qtconnectivity-dev
	qt5-qtdeclarative-dev
	qt5-qtmultimedia-dev
	qt5-qtserialport-dev
	qt5-qtsvg-dev
	qt5-qttools-dev
	qt5-qtwebchannel-dev
	qt5-qtwebsockets-dev
	qt5-qtx11extras-dev
	"
source="https://pypi.python.org/packages/source/P/PyQt5/PyQt5-$pkgver.tar.gz"
builddir="$srcdir/PyQt5-$pkgver"

prepare() {
	default_prepare
	sed -i '/target_config.dbus_inc_dirs = \[\]/d' configure.py
}

build() {
	sip-build \
		--confirm-license \
		--qmake /usr/lib/qt5/bin/qmake \
		--api-dir /usr/share/qt5/qsci/api/python \
		--no-make
#	find . -name 'Makefile' -print0 | xargs sed -i 's|-Wl,-rpath,/usr/lib||g;s|-Wl,-rpath,.* ||g'
	make -C build
}

check() {
	make -C build check
}

package() {
	make DESTDIR="$pkgdir" INSTALL_ROOT="$pkgdir" -C build install -j1
}

sha512sums="
65fd663cb70e8701e49bd4b39dc9384546cf2edd1b3bab259ca64b50908f48bdc02ca143f36cd6b429075f5616dcc7b291607dcb63afa176e828cded3b82f5c7  PyQt5-5.15.6.tar.gz
"
